/*
 * @Author: ujjldn ujjldn0515@163.com
 * @Date: 2025-06-24 19:01:14
 * @LastEditors: ujjldn ujjldn0515@163.com
 * @LastEditTime: 2025-06-25 19:29:08
 * @FilePath: \g-table1\vite.config.options-editor.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * 
 */
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import {resolve} from 'path'

export default defineConfig({
  resolve: {
    alias: {
        "@": resolve(__dirname, 'src'), // 路径别名
    },
    extensions: ['.js', '.vue', '.json', '.ts'] // 使用路径别名时想要省略的后缀名，可以自己 增减
  },
  build: {
    outDir: '../dist',
    lib: {
      entry: './options-editor.js',
      name: 'GTableOptionsEditor',
      fileName: (format) => `g-table-options-editor.${format}.js`
    },
    rollupOptions: {
      external: ['vue', 'element-plus', 'axios'],
      output: {
        globals: {
          vue: 'Vue',
          'element-plus': 'ElementPlus',
          axios: 'axios'
        }
      }
    }
  },
  plugins: [vue()]
})